import 'package:flutter/material.dart';
import 'package:flutter_app_05/action/states/data_manager.dart';
import 'package:flutter_app_05/data/model.dart';
import 'package:flutter_app_05/http/nets.dart';
import 'package:flutter_app_05/page/more_dtl.dart';
import 'package:flutter_app_05/utils/MyTheme.dart';
import 'package:flutter_app_05/utils/ScreenAdapter.dart';
import 'package:flutter_app_05/widget/sdk_extends.dart';
import 'package:flutter_app_05/widget/stateful_widget_extends.dart';
import 'login/login.dart';
import 'more01.dart';
import 'more02.dart';
class _TabData {
  final Widget tab;
  final Widget body;

  _TabData({this.tab, this.body});
}
final _tabDataList = <_TabData>[
  _TabData(tab: Text('琅卡博'), body: More01Page(),),
  _TabData(tab: Text('其他'), body: More02Page(),)
];
class MorePage extends StatefulWidget{

  @override
  MorePagePageState createState() => new MorePagePageState();


}



class MorePagePageState extends State<MorePage>{
  final tabBarList = _tabDataList.map((item) => item.tab).toList();
  final tabBarViewList = _tabDataList.map((item) => item.body).toList();
  List<InfoData> _list;

  @override
  Widget build(BuildContext context) {

    return  Scaffold(
      backgroundColor:MyTheme(context).getColor("bg"),
      appBar: AppBar(
        title: Center(child: Text("更多"),),
        backgroundColor: MyTheme(context).getColor("app_green"),
      ),
      body: DefaultTabController(
          length: tabBarList.length,
          child: Column(
            children: <Widget>[
              Container(
                width: double.infinity,
                height: 50,
                alignment: Alignment.centerLeft,
                color: MyTheme(context).getColor("white"),
                child: TabBar(
                    indicator: const BoxDecoration(),
                    isScrollable: true,
                    indicatorColor: MyTheme.colorLight['app_green'],
                    indicatorSize: TabBarIndicatorSize.label,
                    unselectedLabelColor:
                    MyTheme(context).getColor("text_unselect"),
                    unselectedLabelStyle: TextStyle(fontSize: 15),
                    labelColor: MyTheme(context).getColor("text_select"),
                    labelStyle: TextStyle(fontSize: 20),
                    tabs: tabBarList),
              ),
              Expanded(
                  child: TabBarView(
                    children: tabBarViewList,
                    // physics: NeverScrollableScrollPhysics(), // 禁止滑动
                  ))
            ],
          )),

    );
    return Column(

      children: [
        Container(
          alignment: Alignment.center,
          color: Colors.green,
          height: 60.0,
          child: Center(child: Text("更多",style: TextStyle(color: Colors.white),),),
        ),

      ],
    );
    return ListView(
      scrollDirection: Axis.vertical,
      children: [

        // ..._list.map((e) => infoModel(context, e)),
      ],
    );
  }
@override
  void initState() {

    // TODO: implement initState
    super.initState();
    // _initInfo();

  }

}

